package com.huabo.system.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.system.oracle.entity.TblMonitorModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-04-28
 */
public interface TblMonitorModelMapper extends BaseMapper<TblMonitorModel> {

    @SelectProvider(type=TblMonitorModelMapperSqlConfig.class,method="findByModelJKZX")
    List<TblMonitorModel> findByModelJKZX(String solutionid, PageInfo<TblMonitorModel> pageInfo);

    @Select("SELECT COUNT(*) from TBL_MONITOR_MODEL TMM LEFT JOIN TBL_MONITOR_SOLUTION_MODEL TMSM ON TMM.MODELID = TMSM.MODELID LEFT JOIN TBL_MONITOR_SOLUTION TMS ON TMSM.SOLUTIONID = TMS.SOLUTIONID WHERE TMS.SOLUTIONID = #{solutionid} ")
    Integer findByModelJKZXCount(String solutionid);
}
